3.35 \(\int \frac{1}{1+\cosh ^2(x)} \, dx\)

Optimal. Leaf size=15 \[ \frac{\tanh ^{-1}\left (\frac{\tanh (x)}{\sqrt{2}}\right )}{\sqrt{2}} \]

[Out]

ArcTanh[Tanh[x]/Sqrt[2]]/Sqrt[2]

________________________________________________________________________________________

Rubi [A]  time = 0.0117789, antiderivative size = 15, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 8, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {3181, 206} \[ \frac{\tanh ^{-1}\left (\frac{\tanh (x)}{\sqrt{2}}\right )}{\sqrt{2}} \]

Antiderivative was successfully verified.

[In]

Int[(1 + Cosh[x]^2)^(-1),x]

[Out]

ArcTanh[Tanh[x]/Sqrt[2]]/Sqrt[2]

Rule 3181

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(-1), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist
[ff/f, Subst[Int[1/(a + (a + b)*ff^2*x^2), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{1}{1+\cosh ^2(x)} \, dx &=\operatorname{Subst}\left (\int \frac{1}{1-2 x^2} \, dx,x,\coth (x)\right )\\ &=\frac{\tanh ^{-1}\left (\frac{\tanh (x)}{\sqrt{2}}\right )}{\sqrt{2}}\\ \end{align*}

Mathematica [F]  time = 0.0221849, size = 0, normalized size = 0. \[ \int \frac{1}{1+\cosh ^2(x)} \, dx \]

Verification is Not applicable to the result.

[In]

Integrate[(1 + Cosh[x]^2)^(-1),x]

[Out]

Integrate[(1 + Cosh[x]^2)^(-1), x]

________________________________________________________________________________________

Maple [B]  time = 0.012, size = 86, normalized size = 5.7 \begin{align*}{\frac{\sqrt{2}}{8}\ln \left ({ \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+\sqrt{2}\tanh \left ({\frac{x}{2}} \right ) +1 \right ) \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}-\sqrt{2}\tanh \left ({\frac{x}{2}} \right ) +1 \right ) ^{-1}} \right ) }-{\frac{\sqrt{2}}{8}\ln \left ({ \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}-\sqrt{2}\tanh \left ({\frac{x}{2}} \right ) +1 \right ) \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+\sqrt{2}\tanh \left ({\frac{x}{2}} \right ) +1 \right ) ^{-1}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(1+cosh(x)^2),x)

[Out]

1/8*2^(1/2)*ln((tanh(1/2*x)^2+2^(1/2)*tanh(1/2*x)+1)/(tanh(1/2*x)^2-2^(1/2)*tanh(1/2*x)+1))-1/8*2^(1/2)*ln((ta
nh(1/2*x)^2-2^(1/2)*tanh(1/2*x)+1)/(tanh(1/2*x)^2+2^(1/2)*tanh(1/2*x)+1))

________________________________________________________________________________________

Maxima [B]  time = 1.56939, size = 46, normalized size = 3.07 \begin{align*} -\frac{1}{4} \, \sqrt{2} \log \left (-\frac{2 \, \sqrt{2} - e^{\left (-2 \, x\right )} - 3}{2 \, \sqrt{2} + e^{\left (-2 \, x\right )} + 3}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cosh(x)^2),x, algorithm="maxima")

[Out]

-1/4*sqrt(2)*log(-(2*sqrt(2) - e^(-2*x) - 3)/(2*sqrt(2) + e^(-2*x) + 3))

________________________________________________________________________________________

Fricas [B]  time = 2.12362, size = 215, normalized size = 14.33 \begin{align*} \frac{1}{4} \, \sqrt{2} \log \left (-\frac{3 \,{\left (2 \, \sqrt{2} - 3\right )} \cosh \left (x\right )^{2} - 4 \,{\left (3 \, \sqrt{2} - 4\right )} \cosh \left (x\right ) \sinh \left (x\right ) + 3 \,{\left (2 \, \sqrt{2} - 3\right )} \sinh \left (x\right )^{2} + 2 \, \sqrt{2} - 3}{\cosh \left (x\right )^{2} + \sinh \left (x\right )^{2} + 3}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cosh(x)^2),x, algorithm="fricas")

[Out]

1/4*sqrt(2)*log(-(3*(2*sqrt(2) - 3)*cosh(x)^2 - 4*(3*sqrt(2) - 4)*cosh(x)*sinh(x) + 3*(2*sqrt(2) - 3)*sinh(x)^
2 + 2*sqrt(2) - 3)/(cosh(x)^2 + sinh(x)^2 + 3))

________________________________________________________________________________________

Sympy [B]  time = 0.951359, size = 60, normalized size = 4. \begin{align*} - \frac{\sqrt{2} \log{\left (4 \tanh ^{2}{\left (\frac{x}{2} \right )} - 4 \sqrt{2} \tanh{\left (\frac{x}{2} \right )} + 4 \right )}}{4} + \frac{\sqrt{2} \log{\left (4 \tanh ^{2}{\left (\frac{x}{2} \right )} + 4 \sqrt{2} \tanh{\left (\frac{x}{2} \right )} + 4 \right )}}{4} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cosh(x)**2),x)

[Out]

-sqrt(2)*log(4*tanh(x/2)**2 - 4*sqrt(2)*tanh(x/2) + 4)/4 + sqrt(2)*log(4*tanh(x/2)**2 + 4*sqrt(2)*tanh(x/2) +
4)/4

________________________________________________________________________________________

Giac [B]  time = 1.23112, size = 46, normalized size = 3.07 \begin{align*} \frac{1}{4} \, \sqrt{2} \log \left (-\frac{2 \, \sqrt{2} - e^{\left (2 \, x\right )} - 3}{2 \, \sqrt{2} + e^{\left (2 \, x\right )} + 3}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cosh(x)^2),x, algorithm="giac")

[Out]

1/4*sqrt(2)*log(-(2*sqrt(2) - e^(2*x) - 3)/(2*sqrt(2) + e^(2*x) + 3))